<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 两数相加
        // function GetSum(num1, num2) {
        //     console.log(num1 + num2);
        // }
        // GetSum(1, 2)
        // GetSum(2, 2)

        // 两数累加和
        function GetSum(num1, num2) {
            var sum = 0;
            for (var i = num1; i <= num2; i++) {
                sum += i;
            }
            console.log(sum);
        }
        GetSum(1, 100);
        GetSum(1, 10)
    </script>
</head>

<body>

</body>

</html>